package com.medusa.aps.business.model.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

public enum AuxiliaryStatus {
    /**
     * 空闲
     */
    IDLE(1, "空闲"),

    /**
     * 使用中
     */
    USING(2, "使用中"),
    /**
     * 维修中
     */
    REPAIRING(3, "维修中"),

    /**
     * 报废
     */
    SCRAP(4, "报废");

    @EnumValue
    private final Integer value;

    private final String desc;

    AuxiliaryStatus(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static AuxiliaryStatus getByDesc(String desc) {
        for (AuxiliaryStatus auxiliaryStatus : AuxiliaryStatus.values()) {
            if (auxiliaryStatus.getDesc().equals(desc)) {
                return auxiliaryStatus;
            }
        }
        return null;
    }

}